package billeterie;
/**
 * 
 * @author samir
 */
public class Trajet {

    private int id_trajet;
    public int distance;
    public Gare gare_arrive;
    public Gare gare_depart;

    public Trajet(int id_trajet, int distance, Gare gare_depart, Gare gare_arrive) {
        this.id_trajet = id_trajet;
        this.distance = distance;
        this.gare_depart = gare_depart;
        this.gare_arrive = gare_arrive;
    }

    public int calculerTrajet(int distanceTrajet) {
        return distance + distanceTrajet;
    }

    public double calculer_cout(String typeTrain) {
        if (typeTrain.equals("TGV")) {
            return distance * .5;//le ocut est 0,5€ par kilométre
        } else {
            return distance * .3;
        }
    }

    public int getId_trajet() {
        return id_trajet;
    }

    public void setId_trajet(int id_trajet) {
        this.id_trajet = id_trajet;
    }

    public int getDistance() {
        return distance;
    }

    public void setDistance(int distance) {
        this.distance = distance;
    }

    public Gare getGare_arrive() {
        return gare_arrive;
    }

    public void setGare_arrive(Gare gare_arrive) {
        this.gare_arrive = gare_arrive;
    }

    public Gare getGare_depart() {
        return gare_depart;
    }

    public void setGare_depart(Gare gare_depart) {
        this.gare_depart = gare_depart;
    }

    @Override
    public String toString() {
        return "Trajet{" + "distance=" + distance + ", gare_arrive=" + gare_arrive + ", gare_depart=" + gare_depart + '}';
    }
}
